import { ADD_ITEM, REMOVE_ITEM, CHANGE_VALUE, INIT_TODO_LIST } from './actionTypes'

export const getAddItemAction = () => ({
  type: ADD_ITEM
})

export const getRemoveItemAction = (value) => ({
  type: REMOVE_ITEM,
  value
})

export const getChangeValueAction = (value) => ({
  type: CHANGE_VALUE,
  value
})


export const getInitTodoListAction = (value) => ({
  type: INIT_TODO_LIST,
  value
})

export const initToDoList =  (dispatch) => {
  const { data } = await axios.get('http://epg.mms.cloudgather.net:8000/restApi/getVodListByTypeId?TYPEID=1405457301925531649&LENGTH=5&STATION=0')
  const action = getInitTodoListAction(data)
  dispatch(action)
}